Skip to content

Update to uv - #592

Merged
RubenImhoff merged 35 commits into
pySTEPS:mainfrom
izzyknmi:update-to-uv
Nov 5, 2026
Merged

RubenImhoff merged 35 commits into
pySTEPS:mainfrom
izzyknmi:update-to-uv

Conversation

@izzyknmi

@izzyknmi izzyknmi commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

This PR swaps Conda for uv.

Notes:

  • This PR adds formatting and import sorting to the tests, and so there are many reformatted files. These can be ignored for reviewing.
  • This PR does not pin versions of libraries in the pyproject.toml, so the uv.lock file is included. A separate PR will pin versions and the lock file can then be removed.

@izzyknmi

izzyknmi commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Really struggling to get everything installed correctly with uv. The issues seem to be GDAL-related:

  • Ubuntu: everything installs OK, but when the tests try to run, the error is No module named '_gdal_array'. (In fact, on my Linux laptop, this also happens! So at least I can debug locally.)
  • MacOS: GDAL can't be installed at version 3.4.1 from Homebrew, but GDAL versions need to match, and we have pinned GDAL at 3.4.1 in the pyproject.
  • Windows: honestly, I have no idea what the problem here is. It's definitely GDAL related but I have no idea how to get GDAL on a Windows machine anyway.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.83838% with 128 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.67%. Comparing base (f1a3af1) to head (5b91ef8).

Files with missing lines Patch % Lines
pysteps/verification/lifetime.py 0.00% 39 Missing ⚠️
pysteps/visualization/spectral.py 13.04% 20 Missing ⚠️
pysteps/visualization/basemaps.py 70.96% 18 Missing ⚠️
pysteps/utils/cleansing.py 83.67% 16 Missing ⚠️
pysteps/utils/conversion.py 94.11% 9 Missing ⚠️
pysteps/utils/transformation.py 93.02% 9 Missing ⚠️
pysteps/visualization/animations.py 91.83% 8 Missing ⚠️
pysteps/utils/images.py 88.00% 3 Missing ⚠️
pysteps/scripts/run_vel_pert_analysis.py 0.00% 2 Missing ⚠️
pysteps/scripts/fit_vel_pert_params.py 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
- Coverage   84.99%   84.67%   -0.33%     
==========================================
  Files         172      172              
  Lines       15445    15397      -48     
==========================================
- Hits        13128    13037      -91     
- Misses       2317     2360      +43     
Flag Coverage Δ
unit_tests 84.67% <83.83%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RubenImhoff

Copy link
Copy Markdown
Contributor

Finally, we can probably ignore the codecov for now..

izzyknmi and others added 2 commits November 5, 2026 09:45
Co-authored-by: Ruben Imhoff <31476760+RubenImhoff@users.noreply.github.com>
Co-authored-by: Ruben Imhoff <31476760+RubenImhoff@users.noreply.github.com>
@izzyknmi

izzyknmi commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi @RubenImhoff! Thanks for your check. I still want to update some documentation, but I think I will do that in a separate PR.

Re: your questions:

  1. One of the great things about uv is the dependency groups. If you take a look at pyproject.toml, there are dependencies and optional dependencies. Those libraries under dependencies are always installed. Optional dependencies are only installed with explicit commands (it's what the above line uv sync --all-extras does). These can be chosen one at a time as well -- this is why the GDAL section is entirely separate, so that it can be installed only if the user chooses they want to mess with GDAL. I've also added PyGrib as a separate dependency group since it seems like Windows has trouble with it.
  2. I understand the issue with the reformatting, sorry about that. Since there's new formatting rules, the formatting tests wouldn't pass without doing the reformatting. In my teams we've always accepted this and made a note in the PR. Is that okay with you?

@izzyknmi

izzyknmi commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Once this works, it might be good to still try pinning versions of libraries (see #527). I wanted some freedom for this step to make sure it all worked, but I'll probably make another PR with pinned versions.

@RubenImhoff

Copy link
Copy Markdown
Contributor

Hi @RubenImhoff! Thanks for your check. I still want to update some documentation, but I think I will do that in a separate PR.

Re: your questions:

  1. One of the great things about uv is the dependency groups. If you take a look at pyproject.toml, there are dependencies and optional dependencies. Those libraries under dependencies are always installed. Optional dependencies are only installed with explicit commands (it's what the above line uv sync --all-extras does). These can be chosen one at a time as well -- this is why the GDAL section is entirely separate, so that it can be installed only if the user chooses they want to mess with GDAL. I've also added PyGrib as a separate dependency group since it seems like Windows has trouble with it.
  2. I understand the issue with the reformatting, sorry about that. Since there's new formatting rules, the formatting tests wouldn't pass without doing the reformatting. In my teams we've always accepted this and made a note in the PR. Is that okay with you?

Perfect, @izzyknmi!

Regarding 1, nice, that is ideal! Nice to have this well described in the documentation (but I know you are working on that).
Regarding 2, no worries, this works for now. :)

@izzyknmi

izzyknmi commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Tests are passing and from my side, this PR is ready! I leave it to @RubenImhoff and @kmuehlbauer to merge it.

@kmuehlbauer kmuehlbauer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Great work @izzyknmi, thanks for the ping.

We might want to let the test workflow depend on the formatter check workflow.

Then, those test would only be run, if the formatter checks return successful.

In in person chat @RubenImhoff was in favour of implementing such dependency.

Comment thread .github/workflows/formatting_checks.yml Resolved
Comment thread .github/workflows/test_pysteps.yml Resolved
@ladc
ladc requested a review from jsvatos November 5, 2026 09:49
Co-authored-by: Kai Mühlbauer <kmuehlbauer@wradlib.org>
Comment thread uv.lock Resolved

@kmuehlbauer kmuehlbauer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite an undertaking! No more complaints from my side!

@RubenImhoff

Copy link
Copy Markdown
Contributor

I'll merge the PR once all test pass. Great work!
@izzyknmi and @kmuehlbauer, any remaining things that should prevent me from merging?

@izzyknmi

izzyknmi commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll merge the PR once all test pass. Great work! @izzyknmi and @kmuehlbauer, any remaining things that should prevent me from merging?

@RubenImhoff All good here! I'll make two new PR's after this, one for pinning versions in pyproject.toml and one for documentation.

@kmuehlbauer

Copy link
Copy Markdown

any remaining things that should prevent me from merging?

Not from my side. Seems good to go.

@RubenImhoff
RubenImhoff merged commit d4631ce into pySTEPS:main Nov 5, 2026
7 checks passed
@izzyknmi
izzyknmi deleted the update-to-uv branch November 5, 2026 11:04
@izzyknmi

Copy link
Copy Markdown
Contributor Author

The promised PR to pin versions and remove uv.lock is #618.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request v2 Breaking changes wrt v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants